Support multiple instance types for spot resilience#264
Open
Harshil-Jani wants to merge 1 commit intomachulav:mainfrom
Open
Support multiple instance types for spot resilience#264Harshil-Jani wants to merge 1 commit intomachulav:mainfrom
Harshil-Jani wants to merge 1 commit intomachulav:mainfrom
Conversation
Allow ec2-instance-type to accept a JSON array of instance types (e.g. '["c5.xlarge", "c5a.xlarge", "m5.xlarge"]') in addition to a single string. When multiple types are provided, the action tries each type in order within each AZ configuration until one succeeds. This is fully backward compatible — existing single-string values work unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ec2-instance-typenow accepts a JSON array of instance types (e.g.'["c5.xlarge", "c5a.xlarge", "m5.xlarge"]') in addition to a single stringThis was requested in #211 (comment by @Preen) and discussed in #85 (Fleet API suggestion). This implementation keeps the existing
RunInstancesapproach (no new IAM permissions needed) while adding instance type diversification for better spot availability.Changes
src/config.js: Parseec2-instance-typeas string or JSON array, validate contentssrc/aws.js: PassinstanceTypeas parameter tocreateEc2InstanceWithParams, add inner retry loop over instance types within each AZ configaction.yml: Updated input descriptionREADME.md: Updated input table + new "Advanced: Multiple instance types" sectionsrc/__tests__/jit.test.js: 6 new tests for parsing/validationTest plan
npm test)